<?php 
/**
* @package DomModuleAdmin.Test
* @author  Oliver Leisalu, Inditel Meedia OÜ
*/
class DMATestModule1Helper {
	
	public $controlValue = 'Muutmata';

	public function otherManager( DMASection $section ) {

		$tab1 = new DMATab('subtab1aae','Subtab 1'); $section->addTab($tab1);
		$tab2 = new DMATab('subtab2aa','Subtab 2 (main)'); $section->addTab($tab2, true);
		$tab3 = new DMATab('subtab3aa','Subtab 3 (empty)'); $section->addTab($tab3);
		
		$set = new DMASet('subtab1set','SubTab 1 header set'); 
		$set->addField( new DMAFieldComment('Teine set alasektsioonis, toimib?') );
		$tab1->addSet($set);
		
		$set = new DMASet('subsettestset','Subset test set');
		$tab1->addSet( $set );

		if( $set->isSubmitted() && $set->getPost('controlValueForsubtest') != 'Mittesobiv' && $set->getPost('controlValueForsubtest') != 'Mittesobiv2' ) {
			$this->controlValue =  $set->getPost('controlValueForsubtest');
			$section->setFinished( true );
		} else if( $set->getPost('controlValueForsubtest') == 'Mittesobiv' or $set->getPost('controlValueForsubtest') == 'Mittesobiv2' ) {
			$set->addField( new DMAFieldWarning('Valisid mittesobiva väärtuse, palun vali sobiv!') );	
		}	
		
		$set->addField( new DMAFieldRadio('controlValueForsubtest',array('Sobiv 1'=>'Sobiv 1','Sobiv 2'=>'Sobiv 2','Mittesobiv'=>'Mitte sobiv','Mittesobiv2'=>'Mitte sobiv 2'),$set->getPost('controlValueForsubtest') ,'Vali sobiv või mitte sobiv','script','onChange="this.form.submit()"') );


		$set = new DMASet('subset2testset','Subset2 test set');
		$set->addField( new DMAFieldWarning('See tab on sisustamata MAIN all!') );	
		$tab2->addSet( $set );
	}
}
?>